# coding=gbk
"""
Created on 2016/6/15 0015

@author: Blunce

@about:

"""
from itertools import count, islice
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd


def save_as_csv(data, filename):
    with open(filename, "w") as fw:
        for line in data:
            x = ""
            for i in range(len(line)):
                x += str(line[i]) + ','
            fw.write(x[:-1] + '\n')


def read_csv(filename, type=float):
    with open(filename) as fr:
        lines = fr.readlines()
        data = []
        for line in lines:
            data.append(np.array(line.strip('\n').split(","), dtype=type))
        return data


if __name__ == '__main__':
    print "**************start**************\n\n"

    print "\n\n**************end**************"
